package org.xiaojinlong.net;

import java.io.*;
import java.net.Socket;

/**
 * Created by jinlong on 2015/3/15.
 */
public class SSS {
    public static void main(String[] args) throws IOException {
            Socket client = new Socket("127.0.0.1", 5432);
            Writer writer = new OutputStreamWriter(client.getOutputStream());
            Reader reader = new InputStreamReader(client.getInputStream());
            writer.write("Hello [from Java]");
            writer.flush(); writer.close();

            char[] buf = new char[200];
            int i = 0;
            reader.close();
            client.close();
    }
}
